<template>
  <div>
    <svg :style="'width:' + size + 'height:' + size">
      <use :xlink:href="prefix + name" :fill="color"></use>
    </svg>
  </div>
</template>

<script setup lang="ts">
defineProps({
  //xlink:href属性值前缀
  prefix: {
    type: String,
    default: '#icon-',
  },
  //svg的名称
  name: {
    type: String,
    required: true,
  },
  //svg的颜色
  color: {
    type: String,
    default: '',
  },
  size: {
    type: String,
    default: '16px',
  },
})
</script>

<style scoped></style>
